<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>终端查询</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<title>终端查询</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<!-- 当前页面样式 -->
<link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
<!-- 当前页面样式 END -->
<script type="text/javascript"
	src="<c:url value="/js/jquery-1.3.2.js" />"></script>
<script type="text/javascript">
$(document).ready(function(){
		$('#sub').click(function(){
			exec();
			$("#queryForm").attr("action","<%=basePath%>/terminal/terminalQuery.ct");
			$("#queryForm").submit();
		});	
	    $("#szPower").click(function() {
		 	$("#queryForm").attr("action","<%=basePath%>/terminal/excelTerminalQuery.ct");
		 	$("#queryForm").submit();
	 	});		
	});
	function addpanel(id,title,html) {
		window.parent.parent.document.getElementById("framemain").contentWindow.addtabs(id,title,html);
	}
			
	function isDetail(str){
		$("#queryForm").attr("action","<%=basePath%>/mer/checkThree.ct?merinfo.id="+str+"&isDetail=0");
		$("#queryForm").submit();
	}
	function exec()
	{
		document.getElementById("sub").setAttribute("disabled", "disabled");
	}
</script>
</head>

<body>
		<s:form id="queryForm" action="/terminal/terminalQuery.ct" method="post"
			theme="simple">
			<table class="tb">
				<tbody>
				<tr class="tb-line">
            		<td class="tb-td" colspan="6"><div class="tb-h2">POS收单运营管理平台</div></td>
        		</tr>
				 <tr class="tb-line">
					<td class="tb-td" colspan="6">
						<div class="tb-h3">终端查询</div>
					</td>
				</tr>

				 <tr class="tb-line">
				 	<td width="12%" style="min-width: 150px" align="right" class="tb-td">
				 	 <div class="tb-h4">商户名：</div>
				 	 </td>
					<td class="tb-td">
                		<s:if test="#session.session_merchant.roleType !=\"15\" ">
                			<label class="tb-input-normal">
							<s:textfield id="midName"
							name="searchCondition.midName" cssClass="queryWidth" />
							</label>
                		</s:if>
                		<s:else>
                			<s:property value="searchCondition.midName"/>
                			<s:hidden name="searchCondition.midName"></s:hidden>
                		</s:else>
							</td>
					<td width="12%" style="min-width: 150px" align="right" class="tb-td">
					<div class="tb-h4">商户号：</div>
					</td>
					<td class="tb-td">
					<s:if test="#session.session_merchant.roleType !=\"15\" ">
                			<label class="tb-input-normal">
							<s:textfield id="midName"
							name="searchCondition.mid" cssClass="queryWidth" />
							</label>
                		</s:if>
                		<s:else>
                			<s:property value="searchCondition.mid"/>
                			<s:hidden name="searchCondition.mid"></s:hidden>
                		</s:else>
					</td>
				
				
				<%-- <s:if test="#session.session_merchant.roleType==\"03\"||#session.session_merchant.roleType==\"15\" || #session.session_merchant.roleType==\"16\"">
				  <td align="right" width="15%"></td>
				  <td>
	                  <s:hidden name="searchCondition.orgCode" value="%{#session.session_merchant.orgCode}" />
				  </td>
			    </s:if>		
			    <s:else> --%>
			        <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                	<div class="tb-h4">所属机构：</div>
            		</td>
					<td class="tb-td">
                	<label class="tb-select">
						<s:select cssClass="queryWidth" name="searchCondition.orgCode"
							id="orgCode"
							list="#request.orgList" listKey="insIdCd" listValue="insName"/>
					</label>
					</td>
			   <%--  </s:else>	 --%>
							
					
				</tr>
				 <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">状态：</div>
            </td>
				<td class="tb-td">
                <label class="tb-select">
				 <s:select id="flag"  name="searchCondition.flag" list="#{'02':'已解绑','01':'正常','00':'已冻结'}" headerKey="" headerValue="--不限--" cssClass="queryWidth" /> 
                </label>
                </td>
				
				  <td align="right" class="tb-td">
                	<div class="tb-h4">终端号：</div>
            	</td>
            	
				 <td class="tb-td">
                <label class="tb-input-normal">
				   <s:textfield id="tid" name="searchCondition.tid" cssClass="queryWidth" />
				</label>
				</td>
						
				<td align="right" class="tb-td">
                <div class="tb-h4">终端SN号：</div>
            	</td>
				<td class="tb-td">
                <label class="tb-input-normal">
			   	 <s:textfield id="termAddr" name="searchCondition.terminalSn" cssClass="queryWidth" />
				</label>
				</td>				
						
				</tr>
				 <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">代理商姓名：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
				 <s:textfield id="realName"  name="searchCondition.realName"  cssClass="queryWidth" /> 
                </label>
                </td>
				
				<td align="right" class="tb-td">
                <div class="tb-h4">代理商手机号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
				   <s:textfield id="tid" name="searchCondition.mobile" cssClass="queryWidth" />
				</label>
				</td>
						
				 <td align="right" class="tb-td">&nbsp;
                <%-- <div class="tb-h4">代理商证件号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
			   	 <s:textfield id="termAddr" name="searchCondition.cardNo" cssClass="queryWidth" />
				</label> --%>
				</td>				
						
				</tr>
				<tr>
						<td colspan="4" align="center"><span style="font-color: red"><s:actionerror /></span>
							<span style="font-color: red;"><s:actionmessage /></span > <span style="font-color: red;"><s:fielderror
									cssClass="fieldError" /></span>
							<span id="otherError"></span>
						</td>
					</tr>
				 <tr class="tb-line">
            		<td class="tb-td line-submit" align="right" colspan="6">
                		<label class="tb-input-submit">
                			<input type="button" value="查询" id="sub"/>
                		</label>
					 	<label class="tb-input-submit">
					 		<s:reset value="取 消" />
					 	</label>
					 	<s:if test="#request.isShowExp==\"1\"">
						   
						   <s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
								
				                <label class="tb-input-submit">
									<input id="szPower" type="submit" value="导出Excel" />
				                </label>
					       </s:if>
						   <s:else>
						   
			                <label class="tb-input-submit">
								<input id="szPower" disabled="disabled" value="导出Excel" type="submit" />
			                </label>
					       </s:else>
					 	</s:if>
					 </td>
				</tr>
				
				<s:if
					test="#request.searchRsList != null && #request.searchRsList.size>0">
					<tr class="tb-line">
						<td class="tb-td paging" colspan="6"><page:pageCount
								max_pages="11" totalPage="${requestScope.totalPage}"
								currentPage="${requestScope.currentPage}"
								action="${rootPath}/terminal/terminalQuery.ct?currentPage=" />

						</td>
					</tr>
				</s:if>
			</table>
			
				
	<div class="big-tb">
    <table class="tb" style="width: 100%;">
				<thead>
            	<tr class="tb-line">
                <th class="tb-th" colspan="11"><div class="tb-h3">终端基本信息列表</div></th>
            	</tr>
					 <tr class="tb-line bg-gray">
						<th class="tb-th">商户号</th>	
						<th class="tb-th">商户名称</th>		
						<s:if test="#session.session_merchant.roleType!=\"03\" && #session.session_merchant.roleType!=\"15\" && #session.session_merchant.roleType!=\"16\"">
						    <th class="tb-th">所属机构</th>
						 </s:if>
						<th class="tb-th">所属代理商</th>
						<th class="tb-th">终端号</th>
						<th class="tb-th">终端序列号</th>
						<th class="tb-th">门店名称</th>
						<th class="tb-th">终端地址</th>
						<th class="tb-th">终端类型</th>
						<th class="tb-th">终端状态</th>
						<!-- <th>操作</th> -->
					</tr>
				</thead>
				<tbody>
					<s:iterator value="#request.terminalList" status="stat" id="term">
							<tr class="tb-line" >
							<td class="tb-td">
							   <%-- <a href="javaScript:isDetail('<s:property value="#term.mid"/>')"> 
							   <s:property value="#term.mid"/> 
							   </a> --%>
							   <s:property value="#term.mid"/>
							</td>
							<td class="tb-td"><s:property value="#term.merName"/></td>
							
							<s:if test="#session.session_merchant.roleType!=\"03\" && #session.session_merchant.roleType!=\"15\" && #session.session_merchant.roleType!=\"16\"">
						   <td class="tb-td"><s:property value="#term.orgName"/></td>
						    </s:if>
						    
							<td class="tb-td"><s:property value="#term.agentName"/></td>
							<td class="tb-td"><s:property value="#term.tid"/></td>
							<td class="tb-td"><s:property value="#term.serialNum"/></td>
							<td class="tb-td"><s:property value="#term.termName"/></td>
							<td class="tb-td"><s:property value="#term.termAddress"/></td>
							<td class="tb-td"><s:property value="#term.tidKind"/></td>
							<td class="tb-td"><s:property value="#term.flag"/></td>							
						</s:iterator>
				</tbody>
			</table>
			</div>
		</s:form>
	<s:if test="#request.info_request !=null">
	<script language="javascript">
	    alert("${request.info_request}");
	    </script>
	</s:if>	
</body>
</html>
